<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/product.css?v=201408281">
		<link rel="stylesheet" href="{$Think.config.RESOURCEURL}wx_assets/community/css/bootstrap.min.css{$Think.config.RESOURCE_VER}" />
		<link rel="stylesheet" href="{$Think.config.RESOURCEURL}wx_assets/css/common.css{$Think.config.RESOURCE_VER}" onerror="_cdnFallback(this)">
		<if condition="$mallHue.mallHue eq '1'">
			<link rel="stylesheet" href="{$Think.config.RESOURCEURL}wx_assets/css/product/coupon_blue.css{$Think.config.RESOURCE_VER}" onerror="_cdnFallback(this)">
			<else/>
			<link rel="stylesheet" href="{$Think.config.RESOURCEURL}wx_assets/css/product/coupon.css{$Think.config.RESOURCE_VER}" onerror="_cdnFallback(this)">
		</if>
		<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/jquery.min.js{$Think.config.RESOURCE_VER}"></script>
		<script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/wx_share.js{$Think.config.RESOURCE_VER}"></script>
		<title>我的优惠券</title>
	</head>
	<style>
		.coupon.active .media-left.select span
		{
			width: 23px;
			height: 23px;
			border-radius: initial;
			border: 0px;
			background: url({$Think.config.RESOURCEURL}wx_assets/images/product/couponselect.png);
			background-size:contain;
		}
	</style>
	
	<body>
	<script>
		$(function(){
			var type=$.util.getParamAsObject().type,
				oid=$.util.getParamAsObject().oid;
			if(type!=0)
			{
				$('.disablebox').hide();
			}
			$('.tab-nav a').each(function(index){
				if(type==index)
				{
					$(this).addClass('active');
				}
				$(this).on('click',function(){
					window.location.href="call.html?customerId={$customerId}&module=product&method=couponList&params=%7B%22type%22:"+index+"}";
				})
			})
		})
	</script>
		<div class="top">
			<a href="javascript:history.go(-1);" class="back">
				<img src="{$Think.config.RESOURCEURL}wx_assets/images/product/arrow-left.png"/>
			</a>
			<div class="middle">
				优惠券
			</div>
		</div>
		<div class="tab-nav">
			<a >未使用({$canuserCount})</a>
			<a >已使用({$useredCount})</a>
			<a >已过期({$overdue})</a>
		</div>
			<div class="couponBox">
				<if condition="$type eq 0">
				<volist name="couponList" id="s">
					<div class="media coupon" userCouponId="{$s.userCouponId}" onclick="goInfo('{$s.userCouponId}')">
						<div class="media">
								<div class="media-body  media-middle">
									<h2>{$s.name}</h2>
									<p style="color: #bebcbc;font-size: 12px;">{$s.recommend}</p>
								</div>
								<div class="media-right ">
									<i>¥</i>{$s['money'] | floatval}
								</div>
					    </div>
					     <if condition="$s['isEffective'] eq 1">
						    <p class="ab-bottom">
								{$s['startTime']}至{$s.endTime}有效
							</p>
						</if>
					</div>
				</volist>
				<else />
				<volist name="couponList" id="c">
					<div class="media coupon disable">
						<div class="media">
							   
								<div class="media-body  media-middle">
									<h2>{$c.name}</h2>
									<p style="color: #bebcbc;font-size: 12px;">{$c.recommend}</p>
									<if condition="$c['status'] eq '2' and $c['nickname'] neq ''">
										<p style="color: #bebcbc;font-size: 12px;margin-top:5px;padding-bottom:10px">赠送给{$c['nickname']}</p>
										<elseif condition="$c['status'] eq '2'"/>
										<p style="color: #bebcbc;font-size: 12px;margin-top:5px;padding-bottom:10px">赠送给朋友</p>
									</if>
								</div>
								<div class="media-right ">
									<i>¥</i>{$c['money'] | floatval}
								</div>
					    </div>
					    <if condition="$c['isEffective'] eq 1">
					    <p class="ab-bottom">
							{$c['startTime']}至{$c.endTime}有效
						</p>
						</if>
						<if condition="$type eq '1'">
						<span class="usedTag">
							<img src="{$Think.config.RESOURCEURL}wx_assets/images/product/used.png"/>
						</span>
						</if>
					</div>
				</volist>
				</if>
			</div>
	<script>
		function goInfo($id){
            location.href  = '{$Think.config.SERVER_HOST}call.html?customerId={$customerId}&module=product&method=couponInfo&params=%7B%22id%22:'+$id+'%7D';
		}
	</script>
			<script>
				$(function(){
						wx_share.init({
						        "pkg":{
						            "appId": '{$pkg.appId}',
						            "timestamp": {$pkg.timestamp},
						            "nonceStr": '{$pkg.nonceStr}',
						            "signature": '{$pkg.signature}'
						        },
						        "hideAllnone":true
						       
				    });
				})
			</script>
	</body>
</html>
